package com.edushare.common.vo;

import com.edushare.common.vo.auto._UserAttributes;

public class UserAttributes extends _UserAttributes {
	public static final int ATTR_INT 	= 10;
	public static final int ATTR_STRING	= 20;
	
	public void setStringValue(String val){
		setUserAttributeStr(val);
		setUserAttributeType(ATTR_STRING);
	}
	
	public void setIntValue(int val){
		setUserAttributeInt(val);
		setUserAttributeType(ATTR_INT);
	}
	
	public int getValueAsInt(){
		if(getUserAttributeType() == ATTR_INT)
			return getUserAttributeInt();
		return 0;
	}
	
	public String getValueAsString(){
		if(getUserAttributeType() == ATTR_INT)
			return getUserAttributeInt().toString();
		return getUserAttributeStr();
	}
}
